Skip to content

Issues/openbmc env shell aliases#2

Open
ajenkins-privafy wants to merge 2 commits intoopencomputeproject:masterfrom
ajenkins-privafy:issues/openbmc-env-shell-aliases
Open

Issues/openbmc env shell aliases#2
ajenkins-privafy wants to merge 2 commits intoopencomputeproject:masterfrom
ajenkins-privafy:issues/openbmc-env-shell-aliases

Conversation

@ajenkins-privafy
Copy link
Copy Markdown

  • If user has a shell alias for ls(1) which alters its output (e.g. ls -F), then openbmc-env fails to generate build/tmp/projdef.mod.cfg. Escape the calling of ls so that the alias is not used.
  • Recently deprecated Python2.x provides method dict.iteritems() to iterate through a dictionary; it is not available in Python3.x, which uses backwards-compatible dict.items() method.

Test (Python2.x machine):

  1. Enter alias 'ls=ls -F'.
  2. Configure build (e.g. TEMPLATECONF=meta-ami/meta-tiogapass/conf . openbmc-env).
  3. projdef.mod.cfg is not created without this patch.
    Test (Python3.x machine):
  4. Repeat 1-3 (python --version returns Python 3.x.x).

If user has a shell alias for ls(1) which alters its output (e.g. 'ls
-F'), then openbmc-env fails to generate build/tmp/projdef.cfg. Escape
the calling of 'ls' so that the alias is not used.
Recently deprecated Python2.x provides method iteritems() to iterate
through a dictionary; it is not available in Python3.x, which uses
backwards-compatible items() method.

References:
  https://www.geeksforgeeks.org/difference-between-dict-items-and-dict-iteritems-in-python/
  https://python-reference.readthedocs.io/en/latest/docs/dict/iteritems.html
  https://python-reference.readthedocs.io/en/latest/docs/dict/items.html
evb=$(ls -d meta-evb/meta-evb-aspeed/meta*)
ami=$(\ls -d meta-ami/meta-*)
evb=$(\ls -d meta-evb/meta-evb-aspeed/meta*)
platform_list="${ami}"$'\n'"${evb}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is find(1) available? what about something like evb=$(find meta/evb-meta-evb-aspeed -type d -name 'meta*') - I guess they are looking for directories only anyway?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants